﻿<Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="WPF3D"
        Width="534"
        Height="254">
    <Grid>
        <!--  Attribute Value With XML Character Entities, e.g., &#10;  -->
        <TextBlock Text="Some&#10;&amp;&gt;&lt;&quot;' Text" />

        <!--
            For SL bug: http://devlicio.us/blogs/derik_whittaker/archive/2011/11/29/runtime-exception-for-pageindex-of-a-datapage.aspx
            To make sure PageSource will be put before PageIndex after formated.
        -->
        <DataPager PageSource="{Binding .}" PageIndex="3" />

        <DockPanel Grid.Row="0"
                   Grid.RowSpan="1"
                   Grid.Column="0"
                   Grid.ColumnSpan="1"
                   Width="Auto"
                   Height="Auto"
                   MinWidth="100"
                   MinHeight="100"
                   MaxWidth="200"
                   MaxHeight="200"
                   Margin="0,0,0,0"
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Stretch"
                   Panel.ZIndex="1">
            <StackPanel>
                <StackPanel.Background>
                    <LinearGradientBrush>
                        <GradientStop Offset="0" Color="White" />
                        <GradientStop Offset=".3" Color="DarkKhaki" />
                        <GradientStop Offset=".7" Color="DarkKhaki" />
                        <GradientStop Offset="1" Color="White" />
                    </LinearGradientBrush>
                </StackPanel.Background>
                <StackPanel Margin="10">
                    <TextBlock Text="Camera X Position:" />
                    <TextBox Name="cameraPositionXTextBox"
                             HorizontalAlignment="Left"
                             MaxLength="5"
                             Text="9" />
                    <TextBlock Text="Camera Y Position:" />
                    <TextBox Name="cameraPositionYTextBox"
                             HorizontalAlignment="Left"
                             MaxLength="5"
                             Text="8" />
                    <TextBlock Text="Camera Z Position:" />
                    <TextBox Name="cameraPositionZTextBox"
                             HorizontalAlignment="Left"
                             MaxLength="5"
                             Text="10" />
                    <Separator />
                    <TextBlock Text="Look Direction X:" />
                    <TextBox Name="lookAtXTextBox"
                             HorizontalAlignment="Left"
                             MaxLength="5"
                             Text="-9" />
                    <TextBlock Text="Look Direction Y:" />
                    <TextBox Name="lookAtYTextBox"
                             HorizontalAlignment="Left"
                             MaxLength="5"
                             Text="-8" />
                    <TextBlock Text="Look Direction Z:" />
                    <TextBox Name="lookAtZTextBox"
                             HorizontalAlignment="Left"
                             MaxLength="5"
                             Text="-10" />
                    <Separator />

                    <Button Name="simpleButton" Click="simpleButtonClick">Simple</Button>
                    <Button Name="cubeButton" Click="cubeButtonClick">Cube</Button>
                </StackPanel>
            </StackPanel>
            <Viewport3D Name="mainViewport" ClipToBounds="True">
                <Viewport3D.Camera>
                    <PerspectiveCamera FarPlaneDistance="100"
                                       FieldOfView="70"
                                       LookDirection="-11,-10,-9"
                                       NearPlaneDistance="1"
                                       Position="11,10,9"
                                       UpDirection="0,1,0" />
                </Viewport3D.Camera>
                <ModelVisual3D>
                    <ModelVisual3D.Content>
                        <DirectionalLight Direction="-2,-3,-1" Color="White" />
                    </ModelVisual3D.Content>
                </ModelVisual3D>
            </Viewport3D>
        </DockPanel>
    </Grid>
</Window>
